package january.test_1_22;

import java.util.Scanner;

public class TestMain3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int tmp = -1;
        int cur = 0;
        int[] arr = new int[n];
        for(int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        if(arr[0] < arr[1]) {
            tmp = 0;
        } else {
            tmp = 1;
        }
        int count = 0;
        for(int i = 1; i < n ; i++) {
            if(arr[i] > arr[i - 1] ) {
                if(tmp == 1 ) {
                    cur = i;
                    tmp = 0;
                    count++;
                }
            }
            if(arr[i] < arr[i - 1] ) {
                if(tmp == 0) {
                    cur = i;
                    tmp = 1;
                    count++;
                }
            }
        }
        System.out.println(count+1);
    }
}
